return {
	"akinsho/toggleterm.nvim",
	config = function()
		local Terminal = require("toggleterm.terminal").Terminal
		function _DBRUN_TOGGLE()
			local dbrun = Terminal:new({
				cmd = string.format("dbrun.sh %s", vim.fn.expand("%:~:.")),
				direction = "vertical",
				close_on_exit = false,
			})

			dbrun:toggle()
		end

		function _PRETEST_TOGGLE()
			local pretest = Terminal:new({
				cmd = string.format("pretest.sh %s", vim.fn.expand("%:~:.")),
				direction = "vertical",
				close_on_exit = false,
			})

			pretest:toggle()
		end

		function _PYTHON_TOGGLE()
			local python = Terminal:new({
				cmd = "python3",
				direction = "float",
				float_opts = {
					border = "curved",
				},
			})

			python:toggle()
		end

		function _NODE_TOGGLE()
			local node = Terminal:new({
				cmd = "node",
				direction = "float",
				float_opts = {
					border = "curved",
				},
			})

			node:toggle()
		end

		function _G.set_terminal_keymaps()
			local opts = { buffer = 0 }
			vim.keymap.set("t", "<esc>", [[<C-\><C-n>]], opts)
			vim.keymap.set("t", "kj", [[<C-\><C-n>]], opts)
			vim.keymap.set("t", "<C-h>", [[<Cmd>wincmd h<CR>]], opts)
			vim.keymap.set("t", "<C-j>", [[<Cmd>wincmd j<CR>]], opts)
			vim.keymap.set("t", "<C-k>", [[<Cmd>wincmd k<CR>]], opts)
			vim.keymap.set("t", "<C-l>", [[<Cmd>wincmd l<CR>]], opts)
			vim.keymap.set("t", "<C-w>", [[<C-\><C-n><C-w>]], opts)
		end

		vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")

		require("toggleterm").setup({
			size = function(term)
				if term.direction == "horizontal" then
					return vim.o.columns * 0.4
				elseif term.direction == "vertical" then
					return vim.o.columns * 0.35
				end
			end,
			hide_numbers = true,
			shade_filetypes = { "NvimTree" },
			shade_terminals = true,
			shading_factor = 2,
			start_in_insert = true,
			insert_mappings = true,
			persist_size = true,
			close_on_exit = true,
			shell = vim.o.shell,
		})
	end,
}
